<template>
	<div id="appList">
		<div style="height:50px;width:100%;">
			<form style="margin:30px">
				<table >
					<tr>
						<th>
							<label>应用编号 :</label>
						</th>
						<td>
							<input type="text" class="form-control" >
						</td>
						<th>
							<label>应用名称 :</label>
						</th>
						<td>
							<input type="text" class="form-control" >
						</td>
						<th>
							<label>用户名称 :</label>
						</th>
						<td>
							<input type="text" class="form-control" >
						</td>
						<td>
							<el-button type="primary">查询</el-button>
						</td>
						<td>
							<el-button type="info" @click="addUser">新增</el-button>
						</td>
					</tr>
				</table>
			</form>
		</div>
        <Table ref="Table" @editUser="editUser"></Table>
		<Dialog ref="Dialog"></Dialog>
        <Tip ref="Tip"></Tip>
	</div>
</template>

<script>
import Dialog from "../components/Dialog";
import Table from "../components/Table";
import Tip from "../components/Tip"
export default {
  name: "userList",
  components: {
    Dialog: Dialog,
    Table: Table,
    Tip:Tip
  },
  data() {
    return {
      dialogSetting: {
        title: "测试对话",
        width: "",
        height: "",
        path: ""
      },
      tableSetting: {
        columns: [
          {
            isChecked: true,
            width: "50px"
          },
          {
            title: "用户编号",
            prop: "userCode",
            width: "100px"
          },
          {
            title: "用户名称",
            prop: "userName",
            width: "100px"
          },{
              title:"登录名称",
              prop:"loginName",
              width:"100px"
          },
          {
            isOperater: true,
            width: "150px",
            ops: [
              {
                opClass: "green",
                opIcon: "icon-pencil",
                callBack: "editUser"
              }
            ]
          }
        ],
        url: "http://localhost:8080",
        load: false,
        width: "500px",
        height: "",
        showPage: true,
        success: false
      }
    };
  },
  mounted() {
    this.$refs.Table.createTab(this.tableSetting);
  },
  methods: {
    addUser() {
      this.$refs.Dialog.dialogShow({
        title: "增加应用",
        width: this.width,
        height: this.height,
        path: "/addApp"
      });
    },
    editUser(data) {
      console.log(data);
    }
  }
};
</script>

<style >

</style>
